package day_2022_4_to_7.day48;

import java.util.Scanner;

/**
 * 小易的升级之路
 * @author haomin
 * @date 2022/05/19 20:28
 **/
public class Day22_1_UpgradeRoad {
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        while (in.hasNext()) {
            int littleMonsterNum = in.nextInt();
            int capacity = in.nextInt();
            for (int i = 0; i < littleMonsterNum; i++) {
                int defense = in.nextInt();
                if (capacity >= defense) {
                    capacity += defense;
                } else {
                    capacity += findComDivisor(capacity, defense);
                }
            }
            System.out.println(capacity);
        }
    }
    private static int findComDivisor(int capacity,int denfense){
        for(int i = capacity;i >= 1 ;i--){
            if(capacity % i == 0 && denfense % i == 0){
                return i;
            }
        }
        return -1;
    }
}